﻿using System;
using System.Collections.Generic;
using System.Text;
using DAL;
using Entity;

namespace Business
{
	public class InLogBusiness
	{
		#region code CMS
        //public static List<InLog> GetInLogList()
        //{
        //    var result = FreshCmsDataAccessProvider.InLog.GetInLogList();
        //    return result;
        //}

        public static List<InLog> GetInLogListByPaging(string mail, int action, DateTime from, DateTime to, int pageIndex, int pageSize, ref int totalRecord)
        {
            var result = FreshCmsDataAccessProvider.InLog.GetInLogListByPaging(mail, action, from, to, pageIndex, pageSize, ref totalRecord);
            return result;
        }

        //public static InLog GetInLogById(int logId)
        //{
        //    var result = FreshCmsDataAccessProvider.InLog.GetInLogById(logId);
        //    return result;
        //}

        /// <summary>
        /// logAction: 0 = Xóa, 1 = Thêm mới, 2 = Update, 3 = thao tác khác (login,sắp xếp, ..)
        /// </summary>
        /// <param name="InLog"></param>
        /// <returns></returns>
        public static int InsertInLog(InLog InLog)
        {
            var result = FreshCmsDataAccessProvider.InLog.InsertInLog(InLog);
            return result;
        }

        //public static int UpdateInLog(InLog InLog)
        //{
        //    var result = FreshCmsDataAccessProvider.InLog.UpdateInLog(InLog);
        //    return result;
        //}

        public static int DeleteInLog(string lstLogChecked)
        {
            var result = FreshCmsDataAccessProvider.InLog.DeleteInLog(lstLogChecked);
            return result;
        }

        public static int DeleteAllInLog()
        {
            var result = FreshCmsDataAccessProvider.InLog.DeleteAllInLog();
            return result;
        }
		#endregion
	}
}